package prototype.persistence.hibernate;

import java.util.List;
import java.sql.Timestamp;

import prototype.persistence.pojo.Scenario;
import prototype.persistence.ScenarioDAO;

import org.hibernate.criterion.Restrictions;

/**
 * <p>Hibernate DAO layer for Scenarios</p>
 * <p>Generated at Sun Jan 03 13:49:53 EET 2010</p>
 *
 * @author Salto-db Generator v1.0.16 / Pojos + Hibernate mapping + Generic DAO
 * @see http://www.hibernate.org/328.html
 */
public class ScenarioHibernateDAO extends
		AbstractHibernateDAO<Scenario, Integer> implements
		ScenarioDAO {

	/**
	 * Find Scenario by name
	 */
	public List<Scenario> findByName(String name) {
		return findByCriteria(Restrictions.eq("name", name));
	}
	
	/**
	 * Find Scenario by mapId
	 */
	@SuppressWarnings("unchecked")
	public List<Scenario> findByMapId(Integer mapId) {
		return findByCriteria(Restrictions.eq("map.mapId", mapId));
	}
	

}
